﻿namespace KnownCMS.Admin.Pages.BaseData;

[Route("/bds/users")]
[Menu(Constants.BaseData, "网站用户", "user", 3)]
public class BdUserList : BaseTablePage<CmUser>
{
    private ICommonService Service;

    protected override async Task OnInitPageAsync()
    {
        await base.OnInitPageAsync();
        Service = await CreateServiceAsync<ICommonService>();
        Table.Form = new FormInfo { Width = 600, SmallLabel = true };
        Table.OnQuery = Service.QueryUsersAsync;

        Table.Column(c => c.Sex).Tag();
        Table.Column(c => c.Status).Tag();
    }

    [Action] public Task Export() => Table.ExportDataAsync();
}